package cn.jbolt.ai.core.fileSplit;

import java.io.Serializable;
import java.util.concurrent.atomic.AtomicInteger;

public class FileSplitCounter implements Serializable {

    private AtomicInteger totalCount = new AtomicInteger(0);

    private AtomicInteger successCount = new AtomicInteger(0);

    private AtomicInteger failCount = new AtomicInteger(0);

    /**
     * 是否分割结束
     */
    private boolean splitOver;

    public void addTotalCount() {
        totalCount.incrementAndGet();
    }

    public void addSuccessCount() {
        successCount.incrementAndGet();
    }

    public void addFailCount() {
        failCount.incrementAndGet();
    }


    public int getTotalCount() {
        return totalCount.get();
    }


    public int getSuccessCount() {
        return successCount.get();
    }


    public int getFailCount() {
        return failCount.get();
    }

    public boolean isSplitOver() {
        return splitOver;
    }

    public void setSplitOver(boolean splitOver) {
        this.splitOver = splitOver;
    }
}
